//
// Unihan Input Method
//
// Copyright © 2002-2007 Sun Wah Linux Ltd.
//
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
// USA
//
// $Id: core.h 757 2007-05-10 08:19:31Z roger $
//

#ifndef _CORE_H
#define _CORE_H

typedef enum _KeyType {
	KT_PREEDIT,
	KT_KICK,
	KT_COMMIT,
	KT_PUNCTUATION,
	KT_PAGE_UP,
	KT_PAGE_DOWN,
	KT_SEL_UP,
	KT_SEL_DOWN,
	KT_MOVE_CURSOR_BEFORE,
	KT_MOVE_CURSOR_AFTER,
	KT_MOVE_CURSOR_FIRST,
	KT_MOVE_CURSOR_LAST,
	KT_PROPERTY,
	KT_EAT,
	KT_PROPAGATE 
} KeyType;

typedef struct _HotKey {
	int modifier;
	int keyCode;
	KeyType type;
} HotKey;

KeyType get_key_type(UnihanIM *uim, IMKeyEvent *kev);
int key_event_cat(UnihanIM *uim, IMKeyEvent *kev);
int key_punctuation(UnihanIM *uim, IMKeyEvent *kev);
int key_event_kick(UnihanIM *uim, IMKeyEvent *kev);
int key_event_commit(UnihanIM *uim, IMKeyEvent *kev);
int key_event_property(UnihanIM *uim, IMKeyEvent *kev);
int page_up(UnihanIM *uim);
int page_donw(UnihanIM *uim);
int sel_up(UnihanIM *uim);
int sel_down(UnihanIM *uim);
int move_cursor_before(UnihanIM *uim);
int move_cursor_after(UnihanIM *uim);
int move_cursor_first(UnihanIM *uim);
int move_cursor_last(UnihanIM *uim);

#endif /* _CORE_H */

// vi:ts=4:nowrap:cin:expandtab
